<?php
/**
 * Created by PhpStorm.
 * User: Raymond
 * Date: 2021-07-16
 * Time: 09:46
 */

namespace ood\LMS;


class BookItem extends Book
{
    private $barcode;
    private $isReferenceOnly;
    private $borrowed;
    private $dueDate;
    private $price;
    private $format;
    private $status;
    private $dateOfPurchase;
    private $publicationDate;
    private $placedAt;

    public function checkout($memberId) {
    if($this->getIsReferenceOnly()) {
        echo ("This book is Reference only and can't be issued");
        return false;
    }
    if(!BookLending::lendBook($this->getBarCode(), $memberId)){
        return false;
    }
        $this->updateBookItemStatus(Book::STATUS_LOANED);
        return true;
    }
}